Modern computing devices may include general-purpose processor cores as well as a variety of hardware accelerators for performing specialized tasks. Certain computing devices may include one or more field-programmable gate arrays (FPGAs), which may include programmable digital logic resources that may be configured by the end user or system integrator. In some computing devices, an FPGA may be used to perform network packet processing tasks instead of using general-purpose compute cores.
P4 is a declarative programming language that may be used to specify how a network switch processes packets. P4 programs have been targeted to execution on FPGAs by building a fully flexible, programmable packet processing pipeline in gates on the FPGA and then compiling the P4 program to be executed by that packet processing pipeline.